//
//  HistoryModel.m
//  ZingBrowser
//
//  Created by -Xh- on 3/1/13.
//  Copyright (c) 2013 -Xh-. All rights reserved.
//

#import "HistoryModel.h"

@implementation HistoryModel

@synthesize historyID;






-(id)init{
    self=[super init];
    if(self){
        prefixString=[NSString stringWithFormat:@"H"];
        
    }
    return self;
}
-(id)initWithTitle:(NSString *)_title AndURL:(NSString *)_url{
    self=[super initWithTitle:_title AndURL:_url];
    if(self){
        prefixString=[NSString stringWithFormat:@"H"];
        
    }
    return self;
}

-(void)generateIDWithNumber:(int)_number{
    NSString* numberString=[NSString stringWithFormat:@"%i",_number];
    historyID=[NSString stringWithString:[prefixString stringByAppendingString:numberString]];
}
-(int)getNumberFromID{
    NSString* numberString=[historyID stringByReplacingOccurrencesOfString:prefixString withString:@""];
    int number=[numberString intValue];
    return number;
}

-(void)toLogWithTag:(NSString *)_tag{
    NSLog(@"---%@---",_tag);
    NSLog(@"HistoryID = %@",self.historyID);
    NSLog(@"Title = %@",self.title);
    NSLog(@"Url = %@",self.url);
    NSLog(@"Date = %@",self.dateAdded);

    //NSLog(@"FavIcon = %@",self.favIcon);
    NSLog(@" ");
}
@end
